package demo.msa.retrofit.hello.client;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class HelloClientApplication implements CommandLineRunner {

    @Autowired
    private HelloClient helloClient;

    public void run(String... args) throws Exception {
        System.out.println(helloClient.say1("world"));
        System.out.println(helloClient.say2("world"));
        System.out.println(helloClient.say3("world"));
        System.out.println(helloClient.say4());
        System.out.println(helloClient.say5("leixin", "leixin2"));
        System.out.println(helloClient.say6("leixin", 30));
        System.out.println(helloClient.say7("leixin", 30));
        System.out.println(helloClient.invoke("say7", new Class<?>[]{String.class, Integer.class},
                new Object[]{"leixin", new Integer(30)}));
    }

    public static void main(String[] args) {
        SpringApplication.run(HelloClientApplication.class, args).close();
    }
}
